package com.example.memosystem.activity.listen;

import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;

import com.example.memosystem.R;

public class ChangeListen implements TextWatcher {

    private EditText ed = null;
    public ChangeListen(EditText ed)
    {
        this.ed = ed;
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {

    }

    @Override
    public void afterTextChanged(Editable s) {
        if(s.length()>0)
        {
            ed.setCompoundDrawablesWithIntrinsicBounds(0,0, R.drawable.x, 0);
        }else {
            ed.setCompoundDrawablesWithIntrinsicBounds(0,0, 0, 0);
        }
    }
}
